<!doctype html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport"
        content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>basic</title>
  <style>
    * {
      margin: 0;
      padding: 0;
    }
    .shower {
      height: 200px;
      width: 1000px;
      border: 1px solid #000000;
      margin: 20px;
      overflow: hidden;
      position: relative;
    }
    .title {
      position: absolute;
      right: 0;
    }
  </style>
</head>
<body>
  <!--  margin百分比 -->
  <section class="shower margin-wrapper">
    <style>
      .margin__box{
        width: 50px;
        height: 50px;
        background: aqua;
        margin: 10%;
        padding: 5px;
        box-sizing: border-box;
      }
      .margin__box__children {
        width: 10px;
        height: 10px;
        background: magenta;
        margin: 10%;
      }
    </style>
    <h1 class="title">margin百分比</h1>
    <div class="margin__box">
      <div class="margin__box__children"></div>
    </div>
  </section>

  <!--  padding百分比 -->
  <section class="shower padding-wrapper">
    <style>
      .padding__box{
        width: 50px;
        height: 50px;
        background: magenta;
        padding: 1%;
        box-sizing: border-box;
      }
      .padding__box__children {
        width: 10px;
        height: 10px;
        background: aqua;
        padding: 10%;
      }
    </style>
    <h1 class="title">padding百分比</h1>
    <div class="padding__box">
      <div class="padding__box__children"></div>
    </div>
  </section>

  <!--  relative百分比 -->
  <section class="shower relative-wrapper">
    <style>
      .relative__box{
        width: 100px;
        height: 50px;
        background: magenta;
        position: relative;
        top: 10%;
        left: 10%;
      }
    </style>
    <h1 class="title">relative百分比</h1>
    <div class="relative__box"></div>
  </section>

  <!--  absolute百分比 -->
  <section class="shower absolute-wrapper">
    <style>
      .absolute__box{
        width: 100px;
        height: 50px;
        background: magenta;
        position: absolute;
        top: 15%;
        right: 10%;
      }
    </style>
    <h1 class="title">absolute百分比</h1>
    <div class="absolute__box"></div>
  </section>

  <!--  fixed百分比 -->
  <section class="shower fixed-wrapper">
    <style>
      .fixed__box{
        width: 100px;
        height: 50px;
        background: magenta;
        position: fixed;
        top: 15%;
        right: 10%;
      }
    </style>
    <h1 class="title">fixed百分比</h1>
    <div class="fixed__box"></div>
  </section>

  <!--  sticky百分比 -->
  <section class="shower sticky-wrapper" style="overflow: scroll">
    <style>
      .sticky__box{
        width: 100px;
        height: 50px;
        background: magenta;
        position: sticky;
        position: -webkit-sticky;
        top: -10%;
      }
    </style>
    <h1 class="title">sticky百分比:不脱离</h1>
    <div class="sticky__box"></div>
    <p>To see the effect of sticky positioning, select the position: sticky option and scroll this container.</p>
    <p>To see the effect of sticky positioning, select the position: sticky option and scroll this container.</p>
    <p>To see the effect of sticky positioning, select the position: sticky option and scroll this container.</p>
    <p>To see the effect of sticky positioning, select the position: sticky option and scroll this container.</p>
    <p>To see the effect of sticky positioning, select the position: sticky option and scroll this container.</p>
    <p>To see the effect of sticky positioning, select the position: sticky option and scroll this container.</p>
    <p>To see the effect of sticky positioning, select the position: sticky option and scroll this container.</p>
    <p>To see the effect of sticky positioning, select the position: sticky option and scroll this container.</p>
    <p>To see the effect of sticky positioning, select the position: sticky option and scroll this container.</p>
    <p>To see the effect of sticky positioning, select the position: sticky option and scroll this container.</p>
    <p>To see the effect of sticky positioning, select the position: sticky option and scroll this container.</p>
    <p>To see the effect of sticky positioning, select the position: sticky option and scroll this container.</p>
    <p>To see the effect of sticky positioning, select the position: sticky option and scroll this container.</p>
    <p>To see the effect of sticky positioning, select the position: sticky option and scroll this container.</p>
    <p>To see the effect of sticky positioning, select the position: sticky option and scroll this container.</p>
    <p>To see the effect of sticky positioning, select the position: sticky option and scroll this container.</p>
  </section>


  <!--  transform百分比 -->
  <section class="shower transform-wrapper">
    <style>
      .transform__box{
        width: 100px;
        height: 50px;
        background: magenta;
        transform: translate3d(10%, 10%, 10px);
      }
    </style>
    <h1 class="title">transform百分比</h1>
    <div class="transform__box"></div>
  </section>
</body>
</html>
